<?php

/**
 * User is just a user with different role: user, admin.
 * Role:
 * user -> an user can use the 52danci service to recite and learning word
 * admin -> an admin can manage the 52danci service and the users
 * 
 * @author hutushen222
 * @version 0.0.1
 * @since 0.0.1
 */
class User {
	
	public function getId() {
		return $this->id;
	}
	
	public function setId($id) {
		$this->id = $id;
	}
	
	public function getUsername() {
		return $this->username;
	}
	
	public function setUsername($username) {
		$this->username = $username;
	}
	
	public function getNickname() {
		return $this->nickname;
	}
	
	public function setNickname($nickname) {
		$this->nickname = $nickname;
	}
	
	public function getPassword() {
		return $this->password;
	}
	
	public function setPassword($password) {
		$this->password = $password;
	}
	
	public function getEmail() {
		return $this->email;
	}
	
	public function setEmail($email) {
		$this->email = $email;
	}
	
	public function getRealname() {
		return $this->realname;
	}
	
	public function setRealname($realname) {
		$this->realname = $realname;
	}
	
	public function getPhoto() {
		return $this->photo;
	}
	
	public function setPhoto($photo) {
		$this->photo = $photo;
	}
	
	public function getGender() {
		return $this->gender;
	}
	
	/**
	 * set the user's gender
	 * 
	 * @param string $gender -- the gender of the user
	 * <-1-> male
	 * <-2-> female
	 */
	public function setGender($gender = "male") {
		$this->gender = $gender;
	}
	
	public function getBirthday() {
		return $this->birthday;
	}
	
	/**
	 * set the birthday of the user
	 * 
	 * @param string $birthday -- the birthday of the user
	 * format: 0000-00-00
	 */
	public function setBirthday($birthday) {
		$this->birthday = $birthday;
	}
	
	public function getRegisterTime() {
		return $this->registertime;
	}
	
	/**
	 * set the register time of the user
	 * 
	 * @param string $registertime -- the registertime of the user
	 * format: 0000-00-00 00:00:00
	 */
	public function setRegisterTime($registertime) {
		$this->registertime = $registertime;
	}
	
	public function getRole() {
		return $this->role;
	}
	
	public function setRole($role = "user") {
		$this->role = $role;
	}
	
	public function getQuestion() {
		return $this->question;
	}
	
	public function setQuestion($question) {
		$this->question = $question;	
	}
	
	public function getAnswer() {
		return $this->answer;
	}
	
	public function setAnswer($answer) {
		$this->answer = $answer;
	}
	
	private $id = 0;
	private $username = '';
	private $nickname = '';
	private $password = '';
	private $email = '';
	
	private $realname = '';
	private $photo = 'default.png';
	private $gender = 'male'; # male female
	private $birthday = '0000-00-00';
	
	private $registertime = '0000-00-00 00:00:00';
	private $role = 'user'; # user admin root
	
	private $question = '';
	private $answer = '';
}

?>